from django.db import models

# Create your models here.
class News(models.Model):
    title = models.CharField('标题', max_length=64, default='', unique=True)
    ctime = models.DateTimeField('发表时间', auto_now_add=True)
    origin = models.CharField('来源', max_length=16, default='', null=True)
    times = models.IntegerField('浏览次数', default=0)
    detail = models.CharField('详情', max_length=10000, default='')
    def __str__(self):
        return f'{self.title}, {self.origin}'
    class Meta:
        db_table = 'news'
        verbose_name = '新闻'
        verbose_name_plural = verbose_name
